<?php echo $this->element("admin_header"); ?>
<div class="posts form">
<?php echo $form->create('Post', array('type' => 'file'));?>
	<fieldset>
 		<legend><?php __('Edit Post');?></legend>
	<?php
		echo $form->input('id');
		
		echo $form->input('title');
		
		echo $form->input('body', array('rows'=>'15'));
		echo $form->input('date');
		echo $form->input('published');
		
		echo $this->element('attachments', array('plugin' => 'media','model'=>'Posts.Post', "assocAlias"=>"Image"));
		echo $this->element('attachments', array('plugin' => 'media','model'=>'Posts.Post', "assocAlias"=>"File"));
		
	?>
	<p><?php __('You will only be able to upload one Image or File at each time'); ?>
	
	</fieldset>
		<fieldset class="category sidebar">
	 		<legend><?php __('Post category');?></legend>
			<?php echo $form->input('Category'); ?>
		</fieldset>
		<fieldset class="images sidebar">
	 		<legend><?php __('Embed images');?></legend>
			<?php if (!empty($this->data['Image'])):?>
				<?php foreach ($this->data['Image'] as $image):?>
					<?php if(!empty($image['basename'])): ?>
					<div class="image">
						<strong><span>[image:<?php echo $image['id']?> size:full]</span></strong>
						<?php echo $mediaImage->resize($image, "thumb"); ?>
					</div>
					<?php endif; ?>
				<?php endforeach; ?>
				<p class="help">How to embed images: [image:{id} size:{thumb|medium|full|original} lightbox:{true}] align:{left|right}</p>
			<?php endif; ?>
		</fieldset>
	<?php echo $form->end('Submit', array('value'=>'Save post'));?>
</div>


